//
//  WTLoginManagerHandle.m
//  WTLiveSDKDemo
//
//  Created by ben on 16/9/27.
//  Copyright © 2016年 ben. All rights reserved.
//

#import "WTLoginManagerHandle.h"


@interface WTLoginManagerHandle ()<WTLoginManager>

@end

@implementation WTLoginManagerHandle


#pragma mark WTLoginManager

- (void)login:(void (^)())success failure:(void (^)(NSError *))failure{
    [[[NIMSDK sharedSDK] loginManager] login:WTConfig.net_accid
                                       token:WTConfig.net_token
                                  completion:^(NSError *error) {
                                      if(!error){
                                          success();
                                      }else {
                                          failure(error);
                                      }
                                  }];

}

- (void)logout:(void (^)())success failure:(void (^)(NSError *))failure{
    [[[NIMSDK sharedSDK] loginManager] logout:^(NSError *error){
        if(!error){
            success();
        }else {
            failure(error);
        }
    }];

}

- (BOOL)isLogin{
    
    return [[[NIMSDK sharedSDK] loginManager] isLogined];
}
@end
